package com.kly.user.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.kly.user.db.dao.UserAlbumsDao;
import com.kly.user.db.entity.UserAlbumsEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* User: yujianfu
* Date: 2023-05-22
* Time: 10:35:52.866
*/

@Repository
public class UserAlbumsDaoImpl extends AbstractBaseMapper<UserAlbumsEntity> implements UserAlbumsDao {


    /**
     * 获取用户相册
     * @param userCode
     * @return
     */
    @Override
    public List<UserAlbumsEntity> selectByUserCode(String userCode) {
        return this.getSqlSession().selectList(this.getStatement("selectByCode"), userCode);
    }

    /**
     * 获取用户相册
     * @param userCode
     * @return
     */
    @Override
    public UserAlbumsEntity selectByType(String userCode, Integer type) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("userCode", userCode);
        map.put("type", type);
        return this.getSqlSession().selectOne(this.getStatement("selectByType"), map);
    }
}